package com.yc.privilege.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.privilege.entity.Function;
import com.yc.privilege.entity.FunctionTree;
import com.yc.privilege.entity.TempPage;
import com.yc.privilege.entity.User;
import com.yc.privilege.mapper.FunctionMapper;
import com.yc.privilege.service.Functionservice;
@Service("functionservice")
public class Functionserviceimpl implements Functionservice {
	
	@Autowired
	private FunctionMapper functionMapper;
	
	@Override
	public List<Function> findnextFunction(String rName,int uid) {
		return functionMapper.findnextFunction(rName,uid);
	}
	@Override
	public int update(Function function) {
		return functionMapper.update(function);
	}

	@Override
	public int deleteById(int fid) {
		return functionMapper.deleteById(fid);
	}

	@Override
	public FunctionTree functionTree(User user) {
		return functionMapper.functionTree(user);
	}
	@Override
	public FunctionTree updateFunctionTree(User user, int rid) {
		return functionMapper.updateFunctionTree(user.getUid(),rid);
	}
	@Override
	public TempPage<Function> findFunctionByPages(int parent_id,int page, int rows) {
		return functionMapper.findFunctionByPages(parent_id,page,rows);
	}
	@Override/**
	 * 批量更新功能信息
	 * @param list
	 * @return
	 */
	public int updateFunction(List<Function> list) {
		
		return functionMapper.updateFunction(list);
	}

}
